#pragma once
#include "..\cpptooltip\PPTooltip.h"

namespace UIExtended
{
	class CColorListCtrl : public CMFCListCtrl
	{
		DECLARE_DYNAMIC(CColorListCtrl)

	public:
		typedef CString  (CCmdTarget::*fGetTooltipText) ( LVHITTESTINFO&, CColorListCtrl&, CString& );
		typedef COLORREF (CCmdTarget::*fGetCellBkColor) ( int , int, CColorListCtrl& );
		typedef COLORREF (CCmdTarget::*fGetCellTextColor) ( int , int, CColorListCtrl& );
		CColorListCtrl();
		virtual ~CColorListCtrl();

	protected:
		DECLARE_MESSAGE_MAP()
		CPPTooltip::CPPToolTip m_tooltip;
		std::pair<CCmdTarget*,fGetTooltipText> GetTooltipText;
		std::pair<CCmdTarget*,fGetCellBkColor> GetCellBkColor;
		std::pair<CCmdTarget*,fGetCellTextColor> GetCellTextColor;
	public:
		UINT m_CurSel;
		afx_msg void NotifyDisplayTooltip(NMHDR * pNMHDR, LRESULT * result); 
		virtual BOOL PreTranslateMessage(MSG* pMsg);
		afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
		void SetToolTipCallBack( CCmdTarget* cmdTarget, fGetTooltipText func);
		void SetCellTextColorCallBack( CCmdTarget* cmdTarget, fGetCellTextColor func);
		void SetCellBkColorCallBack( CCmdTarget* cmdTarget, fGetCellBkColor func);
		virtual COLORREF OnGetCellBkColor(int,int);
		virtual COLORREF OnGetCellTextColor(int,int);
	};


}